package com.asset.admin.controller;

import com.asset.admin.business.bill.biz.ISysBillBiz;
import com.asset.admin.system.syemenu.form.MenuForm;
import com.asset.bill.dao.entity.BillEntity;
import com.asset.bill.form.BillForm;
import com.asset.bill.form.BillQueryForm;
import com.asset.common.pageform.PageForm;
import com.asset.common.result.ResultMsg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * todo 描述
 * </p>
 *
 * @author 牧之
 * @date 2024/10/13 22:57
 */
@RestController
@RequestMapping("/sysbill")
public class SysBillController {

    @Autowired
    private ISysBillBiz sysBillBiz;

    @ResponseBody
    @RequestMapping(value = "/getList",method = RequestMethod.GET)
    public PageForm<MenuForm> getList(BillQueryForm queryForm){
        return sysBillBiz.getBillList(queryForm);
    }

    @ResponseBody
    @RequestMapping(value = "/updateBill",method = RequestMethod.POST)
    public ResultMsg updateBill(@RequestBody BillForm billForm){
        return sysBillBiz.updateBill(billForm);
    }

    @ResponseBody
    @RequestMapping(value = "/deleteBill",method = RequestMethod.POST)
    public ResultMsg deleteBill(@RequestParam("id")Long id){
        return sysBillBiz.deleteById(id);
    }

    @ResponseBody
    @RequestMapping(value = "/getBillById",method = RequestMethod.POST)
    public BillEntity getBillById(@RequestParam("id")Long id) {
        return sysBillBiz.getBillById(id);
    }
}
